import 'package:flutter/material.dart';
import 'package:flutter_base_widget/base/base.dart';

class ReorderlistViewScreen extends BasePage {

  @override
  // TODO: implement title
  String get title => "长按交换排序";

  final List<int> myitems = [1,2,3,4,5];
  @override
  Widget rebuild(BuildContext context) {
    return ReorderableListView(
      onReorder: (oldIndex, newIndex){
        print(oldIndex.toString()+"---"+newIndex.toString());
      },
      children: <Widget>[
        for(final item in myitems)
          ListTile(
            key: ValueKey(item.toString()),
            title: Text("Item $item"),
          )
      ],
    );
  }
}